/*
 *                  BioJava development code
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  If you do not have a copy,
 * see:
 *
 *      http://www.gnu.org/copyleft/lesser.html
 *
 * Copyright for this code is held jointly by the individual
 * authors.  These should be listed in @author doc comments.
 *
 * For more information on the BioJava project and its aims,
 * or to join the biojava-l mailing list, visit the home page
 * at:
 *
 *      http://www.biojava.org/
 * 
 * Created on Aug 15, 2007
 * 
 */

package uk.ac.sanger;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletException;

public class CoordinateTimer extends TimerTask {

	public static long ONCEPEHOUR = 1000 * 60 * 60;
	public static long tensecs = 1000 * 10 ;
	
	
	public  CoordinateTimer(){
		System.out.println("init coordinate timer");
	}
	
	 public static void main (String[] arguments ) {
		 
		 

			System.setProperty("proxySet", "true");
	        System.setProperty("proxyHost", "wwwcache.sanger.ac.uk");
	        System.setProperty("proxyPort", "3128");

		 
		    TimerTask fetchCoords  = new CoordinateTimer();
		   
		    Timer timer = new Timer();
		    timer.schedule(fetchCoords,0);
		    //stimer.cancel();
		    
		  }
	
	public void run() {
		updateCoordinates();
		
	}
	
	private  void updateCoordinates(){
		Date d = new Date();
		System.out.println("updateCoords " + d);
		
		UpdateCoordinate update = new UpdateCoordinate();
		
		update.makeUpdateCoordinates();
		
	}

}
